package com.acme.bankapp.domain;

import java.util.ArrayList;

/**
 * 
 * Holds Clients and provides access to them.
 *
 */
public class Bank {
	
	ArrayList<Client> clients;
	
	public Bank() {
		clients = new ArrayList<Client>();
	}
	
	/**
	 * Returns a reference to the internal list of clients.
	 * @return ArrayList(Client)
	 */
	public ArrayList<Client> getClients() {
		return clients;
		
	}
	
	/** 
	 * Returns a Client object with the specified name.
	 * @param clientName - Name of the desired client. 
	 * @return Client object if such a client is present; null otherwise.
	 */
	public Client getClientByName(String clientName) {
		for (Client client : clients) {
			if (client.getName() == clientName) {
				return client; 
			}
		}
		
		return null;
	}

}
